//文件hash值，视频宽、高、长度
import http from '@/utils/axios.js'
export const compressVideo = function (hash, width, height, duration) {
    const isVertical = height > width//是否是竖版视频
    let scaling, compress_width, compress_height //缩放率,缩放后的宽、高
    if (isVertical) {
        scaling = height > 360 ? height / 360 : 1
        compress_height = 360
        compress_width = Math.floor(width / scaling)
    } else {
        scaling = width > 360 ? width / 360 : 1
        compress_width = 360
        compress_height = Math.floor(height / scaling)
    }
    http.post('app/pan/video/compress', { hash, width, height, duration, compress_height, compress_width }).then(res => {
        console.log(res)
    })

}